package com.study.english.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.english.pojo.vo.SysAdvertisementLogVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.study.english.domain.SysAdvertisementLog;
import com.study.english.service.ISysAdvertisementLogService;
import com.study.english.mapper.SysAdvertisementLogMapper;
import org.springframework.stereotype.Service;

/**
 * @author wf
 * @description 针对表【sys_advertisement_log】的数据库操作Service实现
 * @createDate 2024-03-11 15:56:34
 */
@Service
public class SysAdvertisementLogServiceImpl extends ServiceImpl<SysAdvertisementLogMapper, SysAdvertisementLog>
        implements ISysAdvertisementLogService {

    @Autowired
    private ISysAdvertisementLogService sysAdvertisementLogService;


    @Override
    public void addSysAdvertisementLog(SysAdvertisementLogVo sysAdvertisementLogVo) {
        SysAdvertisementLog sysAdvertisementLog = new SysAdvertisementLog();
        BeanUtils.copyProperties(sysAdvertisementLogVo, sysAdvertisementLog);
        sysAdvertisementLog.setIsDelete(0);
        sysAdvertisementLog.setCreateTime(new Date());
        sysAdvertisementLogService.save(sysAdvertisementLog);
    }

    @Override
    public IPage<SysAdvertisementLogVo> getSysAdvertisementLogPageList(IPage<SysAdvertisementLogVo> page, SysAdvertisementLogVo sysAdvertisementLogVo) {
        return this.baseMapper.getSysAdvertisementLogPageList(page, sysAdvertisementLogVo);
    }


    @Override
    public List<SysAdvertisementLogVo> getSysAdvertisementLogList(SysAdvertisementLogVo sysAdvertisementLogVo) {
        return this.baseMapper.getSysAdvertisementLogList(sysAdvertisementLogVo);

    }

    @Override
    public SysAdvertisementLog getSysAdvertisementLogById(String id) {
        return sysAdvertisementLogService.getById(id);
    }


    @Override
    public void delSysAdvertisementLog(String id) {
        sysAdvertisementLogService.removeById(id);
    }


    @Override
    public void updateSysAdvertisementLog(SysAdvertisementLogVo sysAdvertisementLogVo) {
        SysAdvertisementLog sysAdvertisementLog = new SysAdvertisementLog();
        BeanUtils.copyProperties(sysAdvertisementLogVo, sysAdvertisementLog);
        sysAdvertisementLogService.updateById(sysAdvertisementLog);
    }
}




